Skip to content

feat(action): add fail action type for infeasible tasks#13

Merged
gwynbleidd003 merged 1 commit intoagiopen-org:mainfrom
aoshen524:feat/fail-action
Feb 5, 2026
Merged

feat(action): add fail action type for infeasible tasks#13
gwynbleidd003 merged 1 commit intoagiopen-org:mainfrom
aoshen524:feat/fail-action

Conversation

@aoshen524
Copy link
Contributor

Summary

  • Add FAIL = "fail" to ActionType enum, allowing models to explicitly signal a task is infeasible
  • Handle fail() across the full pipeline: output parser, action handlers, socketio server, prompt template
  • Add comprehensive test coverage for the new action type

Motivation

During task evaluation, models sometimes encounter infeasible tasks (e.g., requested application not installed, required file missing). Previously, models had no way to express "this task cannot be completed." The fail() action gives models an explicit escape hatch, which downstream evaluators can use to score infeasible task detection.

Changes

File Change
types/models/action.py Add FAIL = "fail" to ActionType enum
utils/output_parser.py fail() sets stop=True (same as finish())
utils/prompt_builder.py Add 11. fail() to instruction template
handler/pyautogui_action_handler.py FINISH | FAIL joint match case
handler/ydotool_action_handler.py FINISH | FAIL joint match case
server/socketio_server.py FAIL case emits finish event
tests/ 5 new test cases + 2 new fixtures

Test plan

  • test_parse_fail_action_sets_stop — parser correctly sets stop flag
  • test_parse_basic_actions[fail()] — parametrized action parsing
  • test_fail_with_other_actions — fail combined with other actions
  • test_multiple_fail_actions_stop_true — multiple fail in sequence
  • test_step_with_failed_response — Actor.step() handles fail response
  • test_fail_action — pyautogui handler accepts fail action
  • test_fail_action_resets_handler — fail resets capslock state

🤖 Generated with Claude Code

Add FAIL action type to allow models to signal a task is infeasible:

- Add FAIL="fail" to ActionType enum
- Set stop=True for fail() in output parser (same as finish())
- Handle FAIL in pyautogui/ydotool handlers (reset state like FINISH)
- Handle FAIL in socketio server (emit finish event)
- Add fail() to prompt template instruction
- Add test coverage for all changes

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@gwynbleidd003 gwynbleidd003 merged commit fde7035 into agiopen-org:main Feb 5, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants